import request from '@/utils/request'
import { data } from 'jquery'

// 查询角色列表
export function listGroup(query) {
  return request({
    url: '/system/group/list',
    method: 'get',
    params: query
  })
}

// 查询角色详细
export function getGroup(roleId) {
  return request({
    url: '/system/group/query/' + roleId,
    method: 'get'
  })
}

// 新增角色
export function addGroup(data) {
  return request({
    url: '/system/group',
    method: 'post',
    data: data
  })
}

// 修改角色
export function updateGroup(data) {
  return request({
    url: '/system/group',
    method: 'put',
    data: data
  })
}

// 角色数据权限
export function dataScope(data) {
  return request({
    url: '/system/group/dataScope',
    method: 'put',
    data: data
  })
}

// 角色状态修改
export function changeGroupStatus(roleId, status) {
  const data = {
    roleId,
    status
  }
  return request({
    url: '/system/group/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除角色
export function delGroup(roleId) {
  return request({
    url: '/system/group/batchRemove/' + roleId,
    method: 'delete'
  })
}

// 删除角色

  export function removeGroup(data) {
    return request({
      url: '/system/group/removeMember',
      method: 'delete',
      data: data
    })
  }